package com.yx.yinshanjinniu.adapters;

import android.content.Context;
import android.text.Html;
import android.widget.TextView;

import com.yx.yinshanjinniu.R;
import com.yx.yinshanjinniu.base.BaseRVAdapter;
import com.yx.yinshanjinniu.base.BaseRVHolder;
import com.yx.yinshanjinniu.base.BaseViewHolder;
import com.yx.yinshanjinniu.bean.HomeHotBean;

import java.util.List;

public class ImportantAdapter extends BaseRVAdapter<HomeHotBean> {
    public ImportantAdapter(Context context, List<HomeHotBean> list) {
        super(context, list);
    }

    @Override
    public int onCreateViewLayoutID(int viewType) {
        return R.layout.item_import_data;
    }

    @Override
    public void onBindView(BaseRVHolder holder, int position) {
        BaseViewHolder viewHolder = holder.getViewHolder();
        HomeHotBean bean = mList.get(position);
        TextView tv_title = viewHolder.get(R.id.tv_title);
        TextView tv_content = viewHolder.get(R.id.tv_content);
        tv_title.setText(bean.title);
        tv_content.setText(Html.fromHtml(bean.content.replaceAll("<img[^>]*>", "")));


    }
}
